-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNT] Automated generation of result examples #434
Conversation
Reviewer's Guide by SourceryThis pull request introduces a new GitHub Actions workflow to automatically update the Sequence diagram for automated example generation workflowsequenceDiagram
participant GH as GitHub Actions
participant CT as Cypress Tests
participant API as Mock FAPI
participant Art as Artifacts
participant Ex as neurobagel_examples repo
GH->>CT: Run e2e tests
CT->>API: Mock API request
API-->>CT: Return mock response
CT->>Art: Save result files as artifacts
GH->>Art: Download artifacts
GH->>Ex: Create PR with updated files
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Deploy Preview for neurobagel-query ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
run: npm install && npm run build | ||
|
||
- name: Run end to end tests | ||
uses: cypress-io/github-action@v6 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
|
||
- name: Create Pull Request | ||
id: create_pr | ||
uses: peter-evans/create-pull-request@v7 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step: create_pr
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up node env | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Create .env file | ||
run: | | ||
echo -e "NB_API_QUERY_URL=https://federate.neurobagel.org/\nNB_ENABLE_AUTH=true\nNB_QUERY_CLIENT_ID=mockclientid" > .env | ||
|
||
- name: build | ||
run: npm install && npm run build | ||
|
||
- name: Run end to end tests | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
wait-on: http://localhost:5173 | ||
start: npm run preview | ||
spec: cypress/e2e/UpdateExamples.cy.ts | ||
component: false | ||
|
||
- name: Upload test artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: query-tool-results | ||
path: cypress/downloads/* | ||
|
||
update-query-tool-results: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
runs-on: ubuntu-latest | ||
needs: generate-example-files | ||
steps: | ||
- name: Generate a token | ||
id: generate-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.NB_BOT_ID }} | ||
private-key: ${{ secrets.NB_BOT_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
|
||
- name: Checkout neurobagel_examples repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: neurobagel/neurobagel_examples | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: query-tool-results | ||
path: neurobagel_examples/query-tool-results | ||
|
||
- name: Create Pull Request | ||
id: create_pr | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ steps.generate-token.outputs.token }} | ||
commit-message: Update `query-tool-results` files | ||
title: Update `query-tool-results` files | ||
body: "This PR updates the `query-tool-results` files with the latest changes." | ||
base: main | ||
branch: update-query-tool-results | ||
committer: NeuroBagel Bot <neurobagel-bot[bot]@users.noreply.github.com> | ||
labels: _bot |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rmanaem for fixing this! Very cool workflow.
I left one idea comment, and one request to change before merging (about comment in the test). Take a look, but I'll approve now already
🧑🍳
Changes proposed in this pull request:
neurobagel_examples
repoNOTE: If this pull request is to be released, the release label must be applied once the review process is done to avoid the local and remote from going out of sync as a consequence of the
bump version
workflow runChecklist
This section is for the PR reviewer
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see our Contributing Guidelines for more info)skip-release
(to be applied by maintainers only)Closes #XXXX
query-tool-results
files in the neurobagel_examples repo have been regeneratedFor new features:
For bug fixes:
Summary by Sourcery
Add a workflow to automatically update the query-tool-results example files in the neurobagel_examples repository.
CI:
Tests: